package sourceFiles;

import java.util.LinkedList;
/**
 * @author LASO-Team
 *
 */
import Exceptions.InvalidAgeParam;
import Exceptions.InvalidCapacity;
import Exceptions.InvalidChildID;
import Exceptions.InvalidHeightParam;
import Exceptions.InvalidRideId;
import Exceptions.TicketDoesntExist;
import Exceptions.CentralComputerExceptions.ChildAgeDoesntMatch;
import Exceptions.CentralComputerExceptions.ChildDoesntHaveTicket;
import Exceptions.CentralComputerExceptions.ChildHeightDoesntMatch;
import Exceptions.CentralComputerExceptions.ChildIDDoesntExist;
import Exceptions.CentralComputerExceptions.RideIDDoesntExist;
import RideExceptions.ChildAlreadyInRideException;
import RideExceptions.ChildNotInRideException;
import RideExceptions.RideActiveException;
import RideExceptions.RideInactiveException;

/**
 * an interface describing the operations of a park ride. a ride can limit the
 * age and height of the children on it, as well as their number. A ride can be
 * running or standing by and can make the transitions between these two states
 * Independently
 * 
 * @author LASO-Team
 * 
 */
public interface IRide {

	/**
	 * Lets the caller configure the parameters of the current Ride
	 * 
	 * @param maxCapacity
	 *            the new maximal capacity of the ride.
	 * @param minAge
	 *            the new minimal age of children which are allowed to enter the
	 *            ride.
	 * @param minHeight
	 *            the minimal height of children which are allowed to enter the
	 *            ride.
	 * @throws InvalidCapacity
	 *             if the capacity is not valid.
	 * @throws InvalidHeightParam
	 *             if the height isn't valid.
	 * @throws InvalidAgeParam
	 *             if the age isn't valid.
	 */
	public void configRideParams(Integer maxCapacity, Integer minAge,
			Integer minHeight) throws InvalidCapacity, InvalidHeightParam,
			InvalidAgeParam;

	/**
	 * The controlling method for the UC of child entrance to the Ride. Might
	 * query the Central Computer for authorization for the Child. changes the
	 * parameters of the ride accordingly (may change the status of the ride to
	 * RUNNING if max capacity of children enterd the ride). A child can
	 * actually enter the ride only if he is not in the ride and the ride is in
	 * STANDBY mode (which means that the entrance gate is opened)
	 * 
	 * @param childID
	 *            the ID of the child who wishes to enter the ride.
	 * @throws RideActiveException
	 *             if the ride is active = on state RUNNING.
	 * @throws InvalidChildID
	 *             if the child had already entered the ride.
	 * @throws ChildAlreadyInRideException
	 *             if the child has already entered the ride.
	 * @throws InvalidRideId
	 *             if ID sent isn't valid.
	 * @throws ChildIDDoesntExist
	 *             if the child isn't registered to the system.
	 * @throws ChildDoesntHaveTicket
	 *             If the child doesn't have a ticket.
	 * @throws ChildAgeDoesntMatch
	 *             if the child's age isn't compatible.
	 * @throws ChildHeightDoesntMatch
	 *             if the child's height isn't compatible.
	 * @throws TicketDoesntExist
	 *             If the child's ticket doesn't exist.
	 * @throws RideIDDoesntExist
	 *             if the ride's ID isn't registered to the system.
	 */
	public void childEntersRide(Integer childID) throws RideActiveException,
			InvalidChildID, ChildAlreadyInRideException, ChildIDDoesntExist,
			InvalidRideId, ChildHeightDoesntMatch, ChildAgeDoesntMatch,
			ChildDoesntHaveTicket, RideIDDoesntExist, TicketDoesntExist;

	/**
	 * The controlling method for the Child exiting the ride. updates the
	 * parameters of the ride accordingly (may change the ride status to STANDBY
	 * if all the children exited the ride). A child can actually exit the ride
	 * only if he is in the ride and the ride is in RUNNING mode (which means
	 * that the exit gate is opened)
	 * 
	 * @param childID
	 *            the ID of the child who wishes to exit the ride.
	 * @throws RideInactiveException
	 *             if the ride is inactive = on state STANDBY.
	 * @throws InvalidChildID
	 *             if the child wasn't in the ride.
	 * @throws ChildNotInRideException
	 *             if the child isn't currently inside the ride.
	 */
	public void childExitsRide(Integer childID) throws RideInactiveException,
			InvalidChildID, ChildNotInRideException;

	/**
	 * Getter for the max capacity of the ride
	 * 
	 * @return the max capacity of the ride
	 */
	public Integer getMaxCapacity();

	/**
	 * Getter for the name of the ride
	 * 
	 * @return the name of the ride
	 */
	public String getRideName();

	/**
	 * Getter for the minimum age of the ride
	 * 
	 * @return the minimum age of the ride
	 */
	public Integer getMinimumAge();

	/**
	 * Getter for the minimum height of the ride
	 * 
	 * @return the minimum height of the ride
	 */
	public Integer getMinimumHeight();

	/**
	 * Getter for the id of the ride
	 * 
	 * @return the id of the ride
	 */
	public Integer getRideID();

	/**
	 * Getter for the centralComputer
	 * 
	 * @return the centralComputer
	 */
	public ICentralComputer getCentralComputer();

	/**
	 * Getter for the entranceGate
	 * 
	 * @return the entranceGate
	 */
	public IGate getEntranceGate();

	/**
	 * Getter for the exitGate
	 * 
	 * @return the exitGate
	 */
	public IGate getExitGate();

	/**
	 * Getter for the state of the ride (RUNNING or STANDBY)
	 * 
	 * @return
	 */
	public RideState getState();
}
